package cn.krui.helper.bean;

import java.util.UUID;

/**
 * @author zc
 * 消息发布，消息实体
 */
public class PublisterBean<T> {
    public PublisterBean() {
    }

    public PublisterBean(String type) {
        this.type = type;
        this.msgUuid = UUID.randomUUID().toString().replaceAll("-","");
    }

    public PublisterBean(String type, T data) {
        this.type = type;
        this.data = data;
        this.msgUuid = UUID.randomUUID().toString().replaceAll("-","");
    }
    
    public PublisterBean(String type, T data, String execUrl) {
        this.type = type;
        this.data = data;
        this.execUrl = execUrl;
        this.msgUuid = UUID.randomUUID().toString().replaceAll("-","");
    }

    /**
     * 消息类型
     */
    private String type;
    /**
     * 消息传达的数据
     */
    private T data;
    /**
     * 消息标识
     */
    private String msgUuid;
    /**
     * 消息处理业务路径 http://host:prot/action
     */
    private String execUrl;

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public String getExecUrl() {
        return execUrl;
    }

    public void setExecUrl(String execUrl) {
        this.execUrl = execUrl;
    }

    public String getMsgUuid() {
        return msgUuid;
    }

    public void setMsgUuid(String msgUuid) {
        this.msgUuid = msgUuid;
    }

}